package ofc4j;

import ofc4j.gallery.GalleryServlet;

import org.mortbay.jetty.Server;
import org.mortbay.jetty.handler.ResourceHandler;
import org.mortbay.jetty.servlet.Context;

public class Gallery {
    public static void main(String... args) throws Exception {
        int port = 8080;
        if (args.length > 0) {
            port = Integer.parseInt(args[0]);
        }
        
        Server s = new Server(port);
        Context root = new Context(s, "/chart", Context.SESSIONS);
        root.addServlet(GalleryServlet.class, "/*");
        
        ResourceHandler handler = new ResourceHandler();
        handler.setResourceBase(".");
        s.addHandler(handler);
        
        s.start();
    }
}
